import sys

from PyQt6.QtCore import Qt
from PyQt6.QtGui import QIcon
from qfluentwidgets import FluentIcon, NavigationItemPosition

import ToolsWindow
import BookMarkWindow

from setting.setting_interface import SettingInterface
from syncFile.syncFile_interface import SyncFileInterface

from PyQt6.QtWidgets import QApplication


def getSysStyle(a0):
    # 获取系统的样式提示
    style_hints = a0.styleHints()
    darkStyle = False

    # 检查明暗模式设置
    if style_hints.colorScheme() is not None:
        if style_hints.colorScheme() == Qt.ColorScheme.Dark:
            darkStyle = True
        else:
            darkStyle = False
    else:
        print("系统未设置明暗模式")

    return darkStyle


if __name__ == '__main__':
    app = QApplication(sys.argv)

    window = ToolsWindow.ToolsWindow()
    window.show()

    # 获取系统颜色模式
    dark_style = getSysStyle(app)

    window.addSubInterface(BookMarkWindow.BookMarkWindow('按钮 1', window),
                           QIcon('./static/bookmark-windows-11/icons8-bookmark-144.svg'),
                           '书签页')
    window.addSubInterface(SyncFileInterface(window), FluentIcon.FOLDER, '文件管理')

    # window.addSubInterface(SyncToolsWindow.SyncToolsWindow('文件同步', window),
    #                        QIcon('./static/synchronize/icons8-synchronize-208.svg'),
    #                        '文件同步')

    # window.addSubInterface(WebWindow.WebWindow('brow', 'https://qfluentwidgets.com/zh/pages/pro/', window),
    #                        FluentIcon.FIT_PAGE,
    #                        '资料页')

    window.addSubInterface(SettingInterface(window), FluentIcon.SETTING,
                           '设置', NavigationItemPosition.BOTTOM)

    sys.exit(app.exec())
